
		<div class="conter">
			<div class="middle">
				<div class="mid-top">
					<h3>商品评论</h3>
					<div class="left">
						<a href="{:U('pro_details',array('pro_id'=>$goods['pro_id']))}"><img src="__PUBLIC__/Home/Images/comments00.jpg"></a>
						<p>{$goods.pro_name}</p>
						<input type="hidden" name="pro_id" id="pro_id" value="{$goods['pro_id']}">
						<input type="hidden" name="order_id" id="order_id" value="{$order['order_id']}">
					</div>
					<div class="right">
						<ul>
							<li>
								描述相符：
								<img src="__PUBLIC__/Home/Images/comments-input.png" value='1'>
								<img src="__PUBLIC__/Home/Images/comments-input.png" value='1'>
								<img src="__PUBLIC__/Home/Images/comments-input.png" value='1'>
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
							</li>
							<li>
								物流服务：
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
							</li>
							<li>
								服务态度：
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
								<img src="__PUBLIC__/Home/Images/comments-input.png">
							</li>	
						</ul>
						
					</div>
				</div>
				<script>
					$(document).ready(function() {
						$(".right ul li:nth-child(1) img").click(function() {
								console.log($(this).index());
								var imglen = $(".right ul li:first-child").find("img").length
								for (i = 0; i <= $(this).index(); i++) {
									if ($(this).attr("src") == "__PUBLIC__/Home/Images/comments-on.png") {
										console.log(123)
										for (var x = imglen; x > $(this).index(); x--) {  
											$(".right ul li:nth-child(1) img").eq(x).attr("src", "__PUBLIC__/Home/Images/comments-input.png")
											$(".right ul li:nth-child(1) img").eq(x).attr('value',1)
										
										}
									} else {
										$(".right ul li:nth-child(1) img").eq(i).attr("src", "__PUBLIC__/Home/Images/comments-on.png")

										$(".right ul li:nth-child(1) img").eq(i).attr('value',2)
									} 
								}
							})
						    $(".right ul li:nth-child(2) img").click(function() {
								console.log($(this).index())
								var imglen = $(".right ul li:first-child").find("img").length
								for (i = 0; i <= $(this).index(); i++) {
									if ($(this).attr("src") == "__PUBLIC__/Home/Images/comments-on.png") {
										console.log(123)
										for (var x = imglen; x > $(this).index(); x--) {  
											$(".right ul li:nth-child(2) img").eq(x).attr("src", "__PUBLIC__/Home/Images/comments-input.png")

											$(".right ul li:nth-child(2) img").eq(x).attr('value',1)
										}
									} else {
										$(".right ul li:nth-child(2) img").eq(i).attr("src", "__PUBLIC__/Home/Images/comments-on.png")
										$(".right ul li:nth-child(2) img").eq(i).attr('value',2)
									} 
								}
							})
						    $(".right ul li:nth-child(3) img").click(function() {
								console.log($(this).index())
								var imglen = $(".right ul li:first-child").find("img").length
								for (i = 0; i <= $(this).index(); i++) {
									if ($(this).attr("src") == "__PUBLIC__/Home/Images/comments-on.png") {
										console.log(123)
										for (var x = imglen; x > $(this).index(); x--) {  
											$(".right ul li:nth-child(3) img").eq(x).attr("src", "__PUBLIC__/Home/Images/comments-input.png")
											$(".right ul li:nth-child(3) img").eq(x).attr("value",1)
										}
									} else {
										$(".right ul li:nth-child(3) img").eq(i).attr("src", "__PUBLIC__/Home/Images/comments-on.png")
										$(".right ul li:nth-child(3) img").eq(i).attr("value",2)
									} 
								}
							})
					})
						
				</script>
				<div class="mid-con">
					<h3>评价宝贝</h3>
					<div class="left">
						<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/comments00.jpg"></a>
					</div>
					<div class="right">
						<textarea placeholder="请输入对宝贝的评价" id="comments" ></textarea>
						<form enctype="multipart/form-data" method="post" action="__SELF__" id="pho">
							<label class="bask"><button>晒照片<input type="file" style="" name="photo" id="photo" /></button></label>
						</form>
						<div class="Choice">
							<label class="om"><input type="radio" name='comment' value="1" checked/>全部</label>
							<label><input type="radio" name='comment' value="2"/>追评</label>
						</div>
						<label class="promptly"><button style="cursor: pointer;">立即评价</button></label>
					</div>
				</div>
				
				<div class="mid-bot">
					<h3>猜你喜欢</h3>
					<ul>
						<li>
							<a href="pro_details.html">
								<img src="__PUBLIC__/Home/Images/comments01.jpg" />
								<span>
									点击查看购买
								</span>
							</a>
						</li>
					
					</ul>
				</div>	
			</div>
			
		</div>
	<script type="text/javascript">
	
				
			$(".Choice label").click(function(){
				$(this).addClass("om")
				$("this").find("input").prop("checked","checked")
				$(this).siblings().removeClass("om")
				$(this).siblings("label").find("input").removeAttr("checked")
			})
					
			var bool = true;
			var	len = $(".mid-bot ul li").length;
			var li_width = $(".mid-bot ul li").outerWidth(true);
			var speed = 3000;
			var time;
			$('.mid-bot ul').width(li_width*len)
			
			time = setInterval(_,speed)
			function _(){
				if(bool){
					bool = false
					$('.mid-bot ul').animate({marginLeft:-li_width+"px"},700,function(){
						$(this).find('li').eq(len-1).after($(this).find('li').eq(0))
						$(this).css("margin-left","0")
						bool = true;
					})
				}else{
					return ;
				}
			}
			
//						
	</script>

	<script type="text/javascript">
		$('.promptly').click(function(){
			var describe = 0;//描述评价
			var transport = 0;//物流评价
			var attitude = 0;//态度评价
			var comments = $("#comments").val();
			var mode = $("input[name='comment']:checked").val();
			var pro_id = $("#pro_id").val();
			var order_id = $("#order_id").val();
			var pho = new FormData($("#pho")[0]);
			// alert(photo);return false;
			$('.right>ul li').eq(0).children().each(function(){
				if($(this).attr('value')==2){
					describe++;
				}
			})
			$('.right>ul li').eq(1).children().each(function(){
				if($(this).attr('value')==2){
					transport++;
				}
			})
			$('.right>ul li').eq(2).children().each(function(){
				if($(this).attr('value')==2){
					attitude++;
				}
			})
			if(comments == ''){
				layer.alert('评价不能为空');
				return false;
			}
			$.ajax({
				url : '',
				type : 'post',
				data : {describe:describe, transport :transport, attitude:attitude,comments:comments,mode:mode,pro_id:pro_id,order_id:order_id},
				dataType:'json',
				// processData:false,		
				// contentType:false,

				success:function(data){
					if(data.code == 1){
						layer.alert(data.info);
					}else{
						layer.alert(data.info);
					}
				}

			});
			


		})
		
	</script>